package cn.hebutrun.oulabot.quartz.job;

import cn.hebutrun.oulabot.common.Constants;
import cn.hebutrun.oulabot.common.util.BotUtil;
import cn.hebutrun.oulabot.common.util.LogUtil;
import lombok.RequiredArgsConstructor;
import org.jetbrains.annotations.NotNull;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

/**
 * @author zhaolong
 * @since 2022-10-24
 */
@RequiredArgsConstructor
public class RemindWeiboCheckinJob extends QuartzJobBean {

  @Override
  protected void executeInternal(@NotNull JobExecutionContext context)
      throws JobExecutionException {
    LogUtil.quartzExecuteInfo(context);
    JobDataMap jobDataMap = context.getJobDetail().getJobDataMap();
    BotUtil.sendMessage(
        "",
        jobDataMap.getLong(Constants.GROUP_ID_JOB_DATA_KEY),
        null,
        BotUtil.getCQAtAll() + "记得微博超话签到领原石哦");
  }
}
